const express = require('express')
const router = express()
const util =require('../../util/acfunutil') ;
//user base info
router.get('/:id', (req, res) => {
    const  headers = util.buildApiHeader();
    util.service.get(util.CDN_API+ `/users/${req.params.id}`,{headers}).then(resp=>{
        res.send(resp.data)
    }).catch(err=>{
        console.log(err)
    })
})
//user posts contents sort by type
router.get('/:id/contents/:type', (req, res) => {
    const  headers = util.buildApiHeader();
    util.service.get(util.CDN_API+ `/searches/up/content/${req.params.id}?type=${req.params.type}`,{headers}).then(resp=>{
        res.send(resp.data)
    }).catch(err=>{
        console.log(err)
    })
})
module.exports = router